Skip to content

feat: use oxlint for faster lint#125

Open
concertypin wants to merge 12 commits intokei-dev/redesignfrom
kei-dev/oxlint
Open

feat: use oxlint for faster lint#125
concertypin wants to merge 12 commits intokei-dev/redesignfrom
kei-dev/oxlint

Conversation

@concertypin
Copy link
Copy Markdown
Owner

Pull Request Template

Description

Introducing oxlint for faster linting.

Checklist

If these questions do not apply to your pull request, just check them.

  • I have tested my changes locally.
  • I have updated the documentation...
  • and JSDoc.
  • I've also checked the code for any linting error/warnings.
  • I formatted the code with the formatter.

Additional Notes

Benchmark needed.

refactor(lint): migrate linting setup to use oxlint as primary tool
refactor(lint): configure ESLint to work alongside oxlint
refactor(lint): update package scripts to use new linting commands
chore(deps): add oxlint and related packages
style(code): suppress oxlint warnings in generated/suppressed files
refactor(code): remove redundant ESLint disables where oxlint handles it
refactor(code): update character store sorting logic to use object access
refactor(code): simplify hook service replacement logic
refactor(code): update worker client proxy call for logging
refactor(code): update LLM config ID generation
refactor(code): remove unused imports and simplify component logic
refactor(test): update test assertions to use oxlint disables
refactor(test): update mock implementations to suppress oxlint warnings
refactor(test): update integration test to use eval safely in mock worker
refactor(test): update chat store mock to suppress warnings
refactor(test): update hook service test context access
refactor(test): update LangChain provider test to suppress warnings
refactor(test): update streaming test to use assert and suppress warnings
refactor(test): update vite config to suppress warnings in path replacement
@concertypin concertypin self-assigned this Feb 17, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @concertypin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces Oxlint into the project's frontend for enhanced linting performance. The change establishes a hybrid linting environment, where Oxlint takes precedence for general JavaScript and TypeScript files, while ESLint continues to cover specific use cases like Svelte templates. This strategic integration aims to improve developer experience by providing faster feedback during development and ensuring code quality more efficiently.

Highlights

  • Introduction of Oxlint for Faster Linting: Oxlint has been integrated as the primary linter to significantly speed up linting processes, leveraging its performance benefits for TypeScript and JavaScript.
  • Hybrid Linting Setup with ESLint: A dual-linter configuration has been established, where Oxlint handles most linting tasks, and ESLint is retained for rules not yet supported by Oxlint, particularly for Svelte-specific templates.
  • Updated Linting Scripts and VSCode Integration: New pnpm scripts (lint:oxlint, lint:eslint, lint, lint:check) have been added to manage the new linting workflow, and VSCode extensions and settings were updated to support Oxlint.
  • Comprehensive Linting Documentation: New documentation has been added to frontend/docs/rules/tools.md detailing the new linter configuration, including how to use Oxlint, ESLint, and their respective plugins.
Changelog
  • .vscode/extensions.json
    • Added the 'oxc.oxc-vscode' extension recommendation for VSCode users.
  • .vscode/settings.json
    • Enabled the 'oxc.typeAware' setting for Oxlint in VSCode.
  • frontend/.oxlintrc.json
    • Added the primary Oxlint configuration file, defining plugins, environment, ignore patterns, overrides for specific file types, and rules.
  • frontend/common/logger/LogBridge.ts
    • Replaced eslint-disable with oxlint-disable for no-console.
  • frontend/docs/rules/tools.md
    • Added new documentation outlining the project's linter and formatter configurations, focusing on Oxlint and ESLint integration.
  • frontend/eslint.config.js
    • Imported eslint-plugin-oxlint to integrate Oxlint with ESLint.
    • Removed type-checking from ESLint configuration, delegating it to Oxlint.
    • Added Oxlint configuration to disable redundant ESLint rules that Oxlint already handles.
  • frontend/package.json
    • Updated check script to use the new lint command.
    • Added new lint:oxlint script to run Oxlint with type-aware checking.
    • Added new lint:eslint script to run ESLint.
    • Modified the main lint script to run both Oxlint and ESLint with auto-fix.
    • Added lint:check script for running both linters without auto-fix.
    • Added eslint-plugin-oxlint, oxlint, and oxlint-tsgolint as development dependencies.
  • frontend/scripts/linter/oxlint-eslint-error.json
    • Added a new Oxlint configuration file defining rules that should be treated as errors.
  • frontend/scripts/linter/oxlint-eslint-warn.json
    • Added a new Oxlint configuration file defining rules that should be treated as warnings.
  • frontend/scripts/linter/oxlint-eslint.json
    • Added a new Oxlint configuration file that extends the error and warning rule sets.
  • frontend/src/components/settingSubpage/AdvancedSettings.svelte
    • Removed an unused import for the Warning component.
  • frontend/src/features/character/adapters/storage/LocalStorageAdapter.ts
    • Updated error handling to include a cause property when throwing Error.
  • frontend/src/features/character/components/settingsSubpage/CharacterAssetsSettings.svelte
    • Renamed the event parameter e to ev in handleFileUpload for consistency.
  • frontend/src/features/character/stores/characterStore.svelte.ts
    • Converted orderMap from Map to Record<string, number> for character sorting.
    • Refactored conditional logic to remove an unnecessary else block for Logger.structured call.
  • frontend/src/features/chat/stores/chatStore.svelte.ts
    • Renamed the settings parameter to providerSettings in setProvider method for clarity.
  • frontend/src/lib/adapters/storage/chat/LocalStorageChatAdapter.ts
    • Updated error handling to include a cause property when throwing Error.
  • frontend/src/lib/interfaces/IHookSystem.ts
    • Replaced eslint-disable-next-line with oxlint-disable-next-line for typescript/no-explicit-any.
  • frontend/src/lib/providers/chat/LangChainBaseProvider.ts
    • Added oxlint-disable-next-line eqeqeq comment to disable a specific Oxlint rule.
  • frontend/src/lib/services/HookService.ts
    • Refactored the conditional structure for string replacement logic.
  • frontend/src/lib/types/IDataModel.ts
    • Changed string concatenation to a template literal for the id default value.
  • frontend/src/lib/workers/workerClient.ts
    • Added an explicit type assertion for api.setLogReceiver.
    • Changed typeof prop == 'symbol' to typeof prop === 'symbol' for strict equality.
  • frontend/src/vite-env.d.ts
    • Added oxlint-disable-next-line no-var comment to disable a specific Oxlint rule.
  • frontend/test/browser/features/character/CharacterHooksSettings.test.ts
    • Replaced eslint-disable comments with oxlint-disable for typescript/no-unsafe-assignment.
  • frontend/test/browser/features/character/CharacterList.test.ts
    • Replaced eslint-disable comments with oxlint-disable for typescript/no-explicit-any and typescript/no-unsafe-return.
  • frontend/test/browser/features/persona/PersonaList.test.ts
    • Replaced eslint-disable comment with oxlint-disable for typescript/no-explicit-any.
  • frontend/test/browser/integration/ChatPersion.test.ts
    • Replaced eslint-disable comment with oxlint-disable for typescript/no-explicit-any.
  • frontend/test/integration/EndToEndHook.test.ts
    • Added oxlint-disable-next-line no-eval comment to disable a specific Oxlint rule.
  • frontend/test/lib/adapters/IDBCharacterAdapter.edge.test.ts
    • Simplified object spread syntax for c.prompt.
  • frontend/test/unit/features/chat/ChatStore.test.ts
    • Replaced eslint-disable comment with oxlint-disable for typescript/no-explicit-any.
  • frontend/test/unit/lib/services/HookService.test.ts
    • Replaced eslint-disable comments with oxlint-disable for no-eval and typescript/no-unsafe-assignment.
  • frontend/test/unit/providers/LangChainBaseProvider.test.ts
    • Replaced eslint-disable comments with oxlint-disable for typescript/no-explicit-any and typescript/no-unsafe-assignment.
  • frontend/test/unit/stores/chatStoreStreaming.test.ts
    • Added assert import from vitest.
    • Simplified the content assertion logic.
    • Replaced eslint-disable comments with oxlint-disable for typescript/no-misused-spread and no-constant-condition.
  • frontend/test/workers/workerClient.test.ts
    • Replaced eslint-disable comments with oxlint-disable for typescript/no-explicit-any and typescript/no-unsafe-return.
  • frontend/vite.config.ts
    • Changed let declarations to const for env and testConfig variables.
    • Added oxlint-disable-next-line typescript/no-explicit-any comment for env variable.
    • Renamed path parameter to writePath in onWritePath function.
  • frontend/worker/scripting/main.ts
    • Replaced eslint-disable-next-line with oxlint-disable-next-line for typescript/await-thenable.
  • pnpm-lock.yaml
    • Updated the lockfile to include new oxlint and eslint-plugin-oxlint dependencies and their transitive dependencies.
Activity
  • The pull request description indicates that a benchmark is needed to evaluate the performance impact of Oxlint.
  • The author has completed the checklist items for local testing, documentation updates, JSDoc, linting error checks, and code formatting.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 17, 2026

Deploy Preview for arisutalk-preview ready!

Name Link
🔨 Latest commit 128da0e
🔍 Latest deploy log https://app.netlify.com/projects/arisutalk-preview/deploys/69b7470033af070008bb10b7
😎 Deploy Preview https://deploy-preview-125--arisutalk-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 87
Accessibility: 97
Best Practices: 92
SEO: 90
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully introduces oxlint for faster linting, which is a great improvement for the development workflow. The configuration is well-structured across several new files, and the npm scripts are updated accordingly. I appreciate the addition of documentation in frontend/docs/rules/tools.md to explain the new setup.

The changes also include several small but valuable code quality improvements, such as adding cause to thrown errors for better debugging and refactoring code for improved readability.

I have one suggestion regarding the new linting scripts to better align with the repository's guidelines for local development performance. Overall, this is a solid contribution.

andjsrk and others added 3 commits February 19, 2026 20:56
- Restructured ESLint to target only Svelte files for performance improvement.

- Configured Oxlint as the primary linter for pure TS/JS files.

- Fixed Svelte 5 false positives by adjusting rune declarations.

- Optimized incremental linting by avoiding global negation patterns.
…ite.config.ts

refactor(deps): move Vitest configuration to dedicated script for better organization
refactor(deps): update ESLint configuration to use Prettier as default formatter for Svelte
refactor(deps): simplify test scripts and remove browser-specific test commands
refactor(deps): update ESLint and OXLint configurations for stricter error reporting
refactor(deps): update tsconfig.common.json to include scripts directory
refactor(deps): update tsconfig.test.json to use explicit paths and remove redundant settings
refactor(deps): update component state declarations to use `let` instead of `const` for reactive variables
refactor(deps): update test paths to use alias for wrapper component
test(config): introduce dedicated browser test configuration file for Vitest
test(provider): annotate GeminiChatProvider connection test for better debugging
@concertypin
Copy link
Copy Markdown
Owner Author

Current workload looks not flaky. Action log

@concertypin concertypin marked this pull request as ready for review February 23, 2026 08:47
This change refactors the monolithic CI workflow (`ci.yml`) into two dedicated workflows: `backend_ci.yml` and `frontend_ci.yml`.

The previous setup was inefficient as it ran all checks (build, lint, test, coverage) for both parts in a single run, often leading to long execution times and unnecessary dependency installations if only one part changed.

The new structure allows:
1. **Backend CI (`backend_ci.yml`):** Focuses only on backend build checks, triggered on PRs to `main` and `kei`.
2. **Frontend CI (`frontend_ci.yml`):** Handles frontend linting, type checking, unit/browser testing (sharded), and coverage reporting. It is triggered only when frontend files or related config change.
3. **Improved Efficiency:** Faster feedback loops by running only relevant checks.
4. **Test Sharding:** The frontend tests are now sharded across multiple jobs (`tests` job) for faster execution, with a dedicated `merge-reports` job to combine results and update status checks.

The old `ci.yml` is removed, and VS Code settings related to Vitest environment variables are cleaned up as they are no longer needed for the new CI structure. Node engine requirement in `package.json` is also updated to be more specific.
Refactor CI workflows to trigger based on changes in specific directories (`backend/**` or `frontend/**`) and workflow files, rather than specific branches. This ensures CI runs when relevant code changes, regardless of the target branch name.
…lint parser options

Removes the duck-typed `TypescriptParserOptions` type definition and the `satisfies` clause. This is done because the type assertion was likely added to work around issues with pnpm hoisting, but it adds unnecessary complexity and might be outdated. ESLint configuration should rely on standard object structure.
@concertypin concertypin force-pushed the kei-dev/oxlint branch 2 times, most recently from 89f9bc3 to 71caa9e Compare February 23, 2026 13:37
@concertypin
Copy link
Copy Markdown
Owner Author

Benchmark Information

VM creation command for benchmark
gcloud compute instances create benchmark \
    --zone=us-central1-f \
    --machine-type=c4-highcpu-4 \
    --network-interface=network-tier=STANDARD,nic-type=GVNIC,stack-type=IPV4_ONLY,subnet=default \
    --no-restart-on-failure \
    --maintenance-policy=TERMINATE \
    --provisioning-model=SPOT \
    --instance-termination-action=STOP \
    --max-run-duration=10800s \
    --no-service-account \
    --no-scopes \
    --min-cpu-platform=Intel\ \
Emerald\ Rapids \
    --create-disk=auto-delete=yes,boot=yes,device-name=benchmark,image=projects/debian-cloud/global/images/debian-12-bookworm-v20260210,mode=rw,provisioned-iops=3000,provisioned-throughput=140,size=15,type=hyperdisk-balanced \
    --no-shielded-secure-boot \
    --shielded-vtpm \
    --shielded-integrity-monitoring \
    --labels=goog-ec-src=vm_add-gcloud \
    --reservation-affinity=none \
    --threads-per-core=2 \
    --turbo-mode=ALL_CORE_MAX
ESLint only setup
🚀 Testing: ESLint Only w/ Cache
   Command: pnpm run lint:eslint
   ⚡ Warming up (2 runs)...
      [05] Last: 1.148s | Mean: 1.156s | CV: 0.5%

🚀 Testing: ESLint Only w/o Cache
   Command: pnpm run lint:eslint --no-cache
   ⚡ Warming up (2 runs)...
      [05] Last: 11.926s | Mean: 11.825s | CV: 0.6%

======================================================================
📊 Linter Performance Benchmark Results
======================================================================
Case                                          |   Mean (s) |    Stdev
----------------------------------------------------------------------
ESLint Only w/ Cache                          |      1.156 |    0.006
ESLint Only w/o Cache                         |     11.825 |    0.068
======================================================================
ESLint(Svelte)+oxlint(other TypeScript) setup
🚀 Testing: Hybrid (Oxlint + ESLint) w/ Cache
   Command: pnpm run lint:oxlint && pnpm run lint:eslint
   ⚡ Warming up (2 runs)...
      [05] Last: 3.826s | Mean: 3.746s | CV: 1.6%

🚀 Testing: Hybrid (Partial Cache Invalidation)
   Command: pnpm run lint:oxlint && pnpm run lint:eslint
   ⚡ Warming up (2 runs)...
      [05] Last: 10.651s | Mean: 10.530s | CV: 1.6%

🚀 Testing: Hybrid (Oxlint + ESLint) w/o Cache
   Command: pnpm run lint:oxlint && pnpm run lint:eslint --no-cache
   ⚡ Warming up (2 runs)...
      [05] Last: 12.333s | Mean: 12.302s | CV: 0.7%

🚀 Testing: Oxlint
   Command: pnpm run lint:oxlint
   ⚡ Warming up (2 runs)...
      [05] Last: 2.531s | Mean: 2.574s | CV: 2.4%

🚀 Testing: ESLint (Svelte Only) w/ Cache
   Command: pnpm run lint:eslint
   ⚡ Warming up (2 runs)...
      [05] Last: 1.121s | Mean: 1.131s | CV: 1.1%

🚀 Testing: ESLint (Svelte Only) w/o Cache
   Command: pnpm run lint:eslint --no-cache
   ⚡ Warming up (2 runs)...
      [05] Last: 9.773s | Mean: 9.758s | CV: 0.2%

======================================================================
📊 Linter Performance Benchmark Results (Hybrid Setup)
======================================================================
Case                                          |   Mean (s) |    Stdev
----------------------------------------------------------------------
Hybrid (Oxlint + ESLint) w/ Cache             |      3.746 |    0.059
Hybrid (Partial Cache Invalidation)           |     10.530 |    0.163
Hybrid (Oxlint + ESLint) w/o Cache            |     12.302 |    0.083
Oxlint                                        |      2.574 |    0.061
ESLint (Svelte Only) w/ Cache                 |      1.131 |    0.012
ESLint (Svelte Only) w/o Cache                |      9.758 |    0.018
======================================================================

@concertypin
Copy link
Copy Markdown
Owner Author

concertypin commented Feb 23, 2026

image

(In my local PC)

Updates various dependencies in `frontend/package.json` to their latest versions. This is done to incorporate bug fixes, performance improvements, and new features from the underlying libraries used in the frontend application.

Also updates test configuration in `frontend/scripts/testConfig.ts` to explicitly include test directories instead of relying on exclusion patterns, improving clarity and robustness of test discovery.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants